import type { IAlign, IConfigBase } from '../base'

type IPrimaryColumn = 'normal' | 'timer' | 'custom'
type IOtherColumn = 'index' | 'selection' | 'operation'

interface IHeader {
  title: string
  btnContent: string
}

interface IContentBase {
  label: string
  width?: string
  align?: IAlign
}

interface IContentPrimary extends IContentBase {
  type?: IPrimaryColumn
  prop: string
  slotName?: string
}

interface IContentOther extends IContentBase {
  type: IOtherColumn
  prop?: string
}

type IContent = IContentPrimary | IContentOther

export interface IContentConfig extends IConfigBase<IContent> {
  /** 是否隐藏分页器 */
  isHidePagination?: boolean
  /** 标题属性 */
  header?: IHeader
  /** 子树元素 */
  childrenTree?: {
    rowKey: string
    treeProps: {
      children: string
      hasChildren?: string
    }
  }
}

export interface IContentProps {
  contentConfig: IContentConfig
}
